import saito.objloader.*;

// declare that we need a OBJModel and we'll be calling it "model"
float test;

// these booleans will be used to turn on and off bits of the OBJModel
boolean bTexture = true;
boolean bStroke = false;
boolean bMaterial = false;
PFont f;

World world;
Animation anim;
GameObject gameObject;
void setup()
{
  size(600, 600, P3D);
  f = loadFont("ArialMT-48.vlw");
  textFont(f,29);

  world = new World(this);
  gameObject = new GameObject(this, true);
  
  frameRate(60);
  
  smooth();
  noStroke();
}

void draw()
{
  //saveFrame("D_ " +i+".png");
  background(32);
  lights();
  //this will do nothing until the model material is turned off
  fill(255);
  text("test", 50, 50);

  translate(width/2, height/2, 0);
  rotateY(-PI/3);
  rotateZ(PI/3);
  gameObject.Draw();
  world.Draw();
}
public void keyPressed()
{
  switch(key)
  {
    case 'w':
      gameObject.position.x+=3;
      break;
    case 's':
      gameObject.position.x-=3;
      break;
    case 'a':
      gameObject.position.z-=3;
      break;
    case 'd':
      gameObject.position.z+=3;
      break;
    default:
      break;
  }
}

